module.exports = app => {
  const { router, controller, middleware } = app;
  // const { auth } = middleware;

  // 字典类型接口
  // 分页
  router.get('/dict/types/page', controller.dictType.list);
  // 字典详情
  router.get('/dict/types/:id/form', controller.dictType.dictTypeForm);
  // 详情
  router.get('/dict/types/:typeCode', controller.dictType.findOne);
  // 添加
  router.post('/dict/types', controller.dictType.save);
  // 修改
  router.put('/dict/types/:id', controller.dictType.save);
  // 删除
  router.delete('/dict/types/:id', controller.dictType.remove);

  // 字典数据接口
  // 字典数据详情
  router.get('/dict/:id/form', controller.dictData.dictDataForm);
  // 分页
  router.get('/dict/page', controller.dictData.list);
  // 添加
  router.post('/dict', controller.dictData.save);
  // 修改
  router.put('/dict/:id', controller.dictData.save);
  // 删除
  router.delete('/dict/:id', controller.dictData.remove);
};
